<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>测试js的promise</title>
    <script src="../zujian/han/han.js"></script>

</head>
<body>
<script type="text/javascript">
    new Promise((resolve,reject)=>{
        var k=false
        if(k){
            resolve(k)
        }else{
            reject(false)
        }
    }).then(onFulfilledValue=>{
        //如果k为true,执行这里输出true,就是说  resolve(k)或者  reject(k)传递的参数在这2个地方可以拿到
        hwrite(onFulfilledValue,111,222)
    }).catch(onRejectedError=>{
        //如果k为false,执行这里输出false
        hwrite(onRejectedError,333,444)
    })
</script>
</body>
</html>